/*
		ServEngine framework library
		A library to fast develop JEE online applications
	
		Copyright 2008 José Ignacio de Córdoba Álvaro

		Licensed under the Apache License, Version 2.0 (the "License");
		you may not use this file except in compliance with the License.
		You may obtain a copy of the License at

				http://www.apache.org/licenses/LICENSE-2.0

		Unless required by applicable law or agreed to in writing, software
		distributed under the License is distributed on an "AS IS" BASIS,
		WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
		See the License for the specific language governing permissions and
		limitations under the License.
	
		Jose Ignacio de Cordoba Alvaro
		http://ignacio.decordoba.com
*/

package com.servengine.log;

import com.servengine.struts.ValidatorForm;

import java.util.Calendar;

public class LogEntriesActionForm extends ValidatorForm
{
	String module, action, methodName, data;
	Integer userId;
	java.util.Calendar from, to;
	String fields;
	int maxResults;

	public void setModule(String module)
	{
		this.module = module;
	}

	public String getModule()
	{
		return module;
	}

	public void setAction(String action)
	{
		this.action = action;
	}

	public String getAction()
	{
		return action;
	}

	public void setMethodName(String methodName)
	{
		this.methodName = methodName;
	}

	public String getMethodName()
	{
		return methodName;
	}

	public void setData(String data)
	{
		this.data = data;
	}

	public String getData()
	{
		return data;
	}

	public void setUserId(Integer userId)
	{
		this.userId = userId;
	}

	public Integer getUserId()
	{
		return userId;
	}

	private void checkDates()
	{
		if (from==null)
			from = getFirstDayInMonth();
		if (to==null)
			to = getLastDayInMonth();
	}

	public void setFrom(Calendar from)
	{
		this.from = from;
	}

	public Calendar getFrom()
	{
	  checkDates();
	  return from;
	}

	public void setTo(Calendar to)
	{
	  this.to = to;
	}

	public Calendar getTo()
	{
	  checkDates();
		return to;
	}

	public void setFields(String fields)
	{
		this.fields = fields;
	}

	public String getFields()
	{
		return fields;
	}

	public void setMaxResults(int maxResults)
	{
		this.maxResults = maxResults;
	}

	public int getMaxResults()
	{
		return maxResults;
	}
}
